Many software technologies in development, such as projects based on managed code, benefit from software tracing. Software tracing is a common practice in which during execution of a program, data is logged when checkpoints are reached in that program. The data is saved at a checkpoint, where it may be later analyzed for various purposes, including testing. For example, if a test fails, the data at one or more checkpoints can be examined to determine what (e.g., what function or sequence of instructions) caused the failure.
In order to make the data accessible, the data is written in some way. Typically, a tester would write the data to a flat text file. Then, the tester would have to rearrange the text into some custom format to help analyze the logged data.
Instead of having unstructured, plain text data, structured logging is another option, in which data is placed into a defined structure such that queries and the like may be performed against the data. Automated analysis, statistics gathering, comparison of the data against thresholds and other such techniques can be performed with structured log data.
Even with structured data, there was no standardization of the structure, and thus, for example, one tester's resulting data may be entirely different from another tester's resulting data, given the same input on the same code. To overcome this problem, some standardization of the structure was made available. For example, to perform structured logging in C# programming language, a library could use an XML serializer that is included in the .NET™ framework to provide more uniform tracing results.
However, there are a number of drawbacks to standardized serializers, including the standard XML serializer. For example, the standard XML serializer does not serialize protected and private properties and fields. However, for logging purposes, as much information as possible about a logged object is often needed, including information about protected properties and data fields. Somewhat similarly, the standard XML serializer cannot serialize custom collections, and cannot serialize dictionaries. Further, the standard XML serializer does not serialize properties that do not have both get-accessors and set-accessors, (note that in C#, for example, each property should have at least one accessor, either set or get, that allows access to that property's value). Another general drawback is that the standard serializer does not provide sufficient control over the serialization process, and has low performance first time any given type is serialized
What is needed is an improved serializer system and method that preserves the original data, while making serialized data easy to read and analyze. The improved serializer should overcome the drawbacks of standard serializers that are available for managed code, and provide more control over the serialization process.